<div lession="container-fluid">
    <h1>Lession index</h1>
    <?php
    $lession = $viewModel->get('lession');
    include 'views/Include/alert.php';
    ?>
    <form action="<?php echo BASE_URL . 'lession/delete'; ?>" method="POST" onsubmit="return ConfirmChoiceDeteleMulti();">
        <a class="btn btn-primary" href="<?php echo BASE_URL . 'lession/create' ?>">Add new</a>
        <button type="submit" class="btn btn-danger">Detele</button>
        <?php
        if ($lession == NULL) {
            echo 'No reslt';
        } else {
            ?>
            <table class="table table-striped" id="tablePagination">
                <thead>
                    <tr>
                        <th></th>
                        <th>#</th>
                        <th>Lession Name</th>
                        <th>Subject Name</th>
                        <th> Theory</th>
                        <th> Lab</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($lession as $lession) { ?>
                        <tr>
                            <td><input name="id[]" type="checkbox" id="checkboxId[]" value="<?php echo $lession->lession_id; ?> "></td>
                            <td><?php echo $lession->lession_id; ?></td>
                            <td><?php echo $lession->lession_name; ?></td>
                            <td><?php echo ($lession->subject_name == null) ? "Undefine" : $lession->subject_name ?></td>
                            <td><?php echo $lession->theory; ?></td>
                            <td><?php echo $lession->lab; ?></td>
                            <td><?php echo ($lession->status == 1) ? "Active" : "Deactive"; ?></td>
                            <td>
                                <div class="btn-group">
                                    <a class="btn" href="<?php echo BASE_URL . 'lession/update/' . $lession->lession_id; ?>"><i class="icon-edit"></i></a>
                                    <a class="btn" href="#" onclick="ConfirmChoiceDelete('<?php echo BASE_URL . 'lession/delete/' . $lession->lession_id; ?>');
                                                    return false;"><i class="icon-remove-sign"></i></a>
                                </div>
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
            <div id="smart-paginator"></div>
        <?php } ?>
    </form>
</div>